﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcContrib;
using System.Web.Routing;

namespace KAKA
{
    public class MobileUnverifiedResult : ActionResult
    {
        public override void ExecuteResult(ControllerContext context)
        {
            var currentVirtualPath = context.RouteData.Route.GetVirtualPath(context.RequestContext, context.RouteData.Values).VirtualPath;
            var verifyMobileRoute = context.RouteData.Route.GetVirtualPath(context.RequestContext,
                 new RouteValueDictionary(new
                 {
                     controller = "Personal",
                     action = "VerifyMobile"
                 })).VirtualPath;
            var verifyMobileUrl = "/" + verifyMobileRoute + "?ReturnUrl=" + context.HttpContext.Server.UrlEncode("/" + currentVirtualPath);

            context.HttpContext.Response.Redirect(verifyMobileUrl);
        }
    }
}